<div id="<?= $this->getAsyncId() ?>">

    <table>
        <thead>
            <tr>
                <th>
                    &nbsp; <!-- boton editar -->
                </th>
                <th>
                    <a class="interior" href="<?=
                    $this->asyncUrlEvent( 'orden',
                            array( 'orden' => (($this->order == 1) ? -1 : 1) ) )
                    ?>">
                        <? if ( abs( $this->order ) == 1 ): ?>
                            <img src="imagenes/img_fondo.gif" class="flecha_orden_<?= (($this->order > 0) ? 'arriba' : 'abajo') ?>_gif" />
<? endif; ?>
                        cif
                    </a>
                </th>
                <th>
                    <a class="interior" href="<?=
                       $this->asyncUrlEvent( 'orden',
                               array( 'orden' => (($this->order == 2) ? -2 : 2) ) )
                       ?>">
                        <? if ( abs( $this->order ) == 2 ): ?>
                            <img src="imagenes/img_fondo.gif" class="flecha_orden_<?= (($this->order > 0) ? 'arriba' : 'abajo') ?>_gif" />
<? endif; ?>
                        nombre
                    </a>
                </th>
                <th>
                    <a class="interior" href="<?=
                           $this->asyncUrlEvent( 'orden',
                                   array( 'orden' => (($this->order == 3) ? -3 : 3) ) )
                           ?>">
<? if ( abs( $this->order ) == 3 ): ?>
                            <img src="imagenes/img_fondo.gif" class="flecha_orden_<?= (($this->order > 0) ? 'arriba' : 'abajo') ?>_gif" />
<? endif; ?>
                        nombre comercial
                    </a>
                </th>
                <th>
                    &nbsp; <!-- boton entrar -->
                </th>
                <th>
                    &nbsp; <!-- boton eliminar -->
                </th>
            </tr>
        </thead>


        <?
        foreach ( $this->childNodes AS $e ):
            ?>
            <?= $e ?>
        <? endforeach; ?>
    </table>
    <form action="." method="get" id="num_x_pagina">
<?= $this->asyncFormEvent( 'paginacion' ) ?>
        <!-- <?= $this->numPorPagina ?> -->
        <select name="paginas" onchange="this.form.submit()">
            <option value="10"<?= (($this->numPorPagina == 10) ? ' selected="selected"' : '') ?>>10 resultados x página</option>
            <option value="20"<?= (($this->numPorPagina == 20) ? ' selected="selected"' : '') ?>>20 resultados x página</option>
            <option value="50"<?= (($this->numPorPagina == 50) ? ' selected="selected"' : '') ?>>50 resuttados x página</option>
        </select>
    </form>
<? include 'templates/pager.tpl.php' ?>
    <strong><?= $this->numItems ?></strong> organizaciones encontradas


    <form action="." method="post"  accept-charset="UTF-8" enctype="multipart/form-data">
            <?= $this->asyncFormEvent( 'crear' ) ?>
        <div>
            <label for="fiscal_id" class="<?=
            (in_array( 'fiscal_id', $this->errors ) ? "" : "")
            ?>">CIF</label><input type="text" size="100" name="fiscal_id" id="fiscal_id" value="<?= htmlspecialchars( $this->form_fiscal_id ) ?>" />
        </div>
        <div>
            <label for="name" class="<?=
            (in_array( 'name', $this->errors ) ? "" : "")
            ?>">Nombre</label><input type="text" size="100" name="name" id="name"  value="<?= htmlspecialchars( $this->form_name ) ?>" />
        </div>
        <div>
            <label for="commercial_name" class=" <?=
            (in_array( 'commercial_name', $this->errors ) ? "" : "")
            ?>">Nombre comercial</label><input type="text" size="100" name="commercial_name" id="commercial_name" value="<?= htmlspecialchars( $this->form_commercial_name ) ?>" />
        </div>
        <div>
            <label for="logo" class=" <?=
            (in_array( 'extension', $this->errors ) ? "" : "")
            ?>">Logotipo</label><input type="file" name="logo" id="logo" />
        </div>
        <div>
            <label for="css">Hoja estilos</label><input type="file" name="css" id="css" />
        </div>
        <input type="submit" value="nueva" />
    </form>

    <form action="." method="get"  accept-charset="UTF-8">
<?= $this->asyncFormEvent( 'busqueda' ) ?>
        <div>
            <label for="fiscal_id" >CIF</label><input type="text" size="100" name="fiscal_id" id="fiscal_id" value="<?= htmlspecialchars( $this->search_fiscal_id ) ?>" />
        </div>
        <div>
            <label for="name" >Nombre</label><input type="text" size="100" name="name" id="name"  value="<?= htmlspecialchars( $this->search_name ) ?>" />
        </div>
        <input type="submit" value="buscar" />
    </form>
</div>